/**
 * @author: lk
 * @data: 2021/11/11 12:53
 */
package core_java.inheritance;

import java.time.LocalDate;

/**
 * 继承测试用例
 */
public class Manager extends Employee {

    private double bonus;

    public Manager(String name, double salary, int year, int month, int day, double bonus) {
        super(name, salary, year, month, day);
        this.bonus = bonus;
    }

    /**
     * 子类调用父类方法，需要使用super关键字。
     * super不同于this。this是引用，而super是关键字。
     *
     * @return
     */
    @Override
    public double getSalary() {
        return super.getSalary() + bonus;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }
}
